package com.agger.harmonyosthemeseditor.intelligent;

public class TextManager
{
    public static String removeSpecificCharArray(String target)
    {
        String returnValue = removeSpecificCharArray(target,"|/<>@#%^&-=");
        returnValue = returnValue.replaceAll("\\{","");
        returnValue = returnValue.replaceAll("\\}","");
        returnValue = returnValue.replaceAll("\\*","");
        returnValue = returnValue.replaceAll("\\+","");
        returnValue = returnValue.replaceAll("\\\\","");
        returnValue = returnValue.replaceAll("\\$","");
        returnValue = returnValue.replaceAll("\\r","");
        returnValue = returnValue.replaceAll("\\n","");
        return returnValue;
    }

    public static String removeSpecificCharArray(String target,String specific)
    {
        return removeSpecificCharArray(target,specific.toCharArray());
    }

    public static String removeSpecificCharArray(String target,char[] specific)
    {
        String returnValue = target;
        for (char c : specific)
        {
            try {returnValue = returnValue.replaceAll(String.valueOf(c), "");} catch (Exception e) {e.printStackTrace();}
        }
        return  returnValue;
    }
    
    public static boolean isNumChar(char t)
    {
        return t=='0'||t=='1'||t=='2'||t=='3'||t=='4'||t=='5'||t=='6'||t=='7'||t=='8'||t=='9'||t=='.';
    }
}
